package com.edu.exam.entity.facility;

import com.edu.exam.enums.core.BaseEnum;

/**
 * 教室分类状态枚举
 *
 * 管理教室分类的状态，包括启用、停用状态
 *
 * @author System
 * @version 1.0.0
 */
public enum CategoryStatus implements BaseEnum {

    /**
     * 启用状态
     */
    ACTIVE("ACTIVE", "启用"),

    /**
     * 停用状态
     */
    INACTIVE("INACTIVE", "停用");

    private final String code;
    private final String description;

    CategoryStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getDescription() {
        return description;
    }

    public static CategoryStatus fromCode(String code) {
        for (CategoryStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown category status code: " + code);
    }
    @Override
    public String toString() {
        return code + " - " + description;
    }
}